from flask_wtf import FlaskForm
from wtforms import SelectField, PasswordField, StringField, SubmitField, IntegerField
from wtforms.validators import DataRequired


class RecordForm(FlaskForm):
    dormitory = SelectField(validators=[DataRequired()], coerce=str)
    floor = IntegerField()
    student_number = StringField()
    opt = StringField()
    place = StringField()
    submit = SubmitField('提交')


class Build(FlaskForm):
    dormitory = StringField(validators=[DataRequired()])
    floor = IntegerField(validators=[DataRequired()])
    submit = SubmitField('提交')


class AddFood(FlaskForm):
    dormitory = SelectField(validators=[DataRequired()], coerce=str)
    floor = IntegerField(validators=[DataRequired()])
    food = SelectField(validators=[DataRequired()], choices=[('fan', '饭'), ('cai', '菜')], default='fan')
    number = IntegerField(validators=[DataRequired()])
    submit = SubmitField('提交')


class FoodDemand(FlaskForm):
    dormitory = SelectField(validators=[DataRequired()], coerce=str)
    floor = IntegerField()
    submit = SubmitField('提交')
